//摄影AMD JS COMMOND JS 和普通JS

(function (root, factory) {
    if (typeof define ==='function' && define.amd)
    {

        define([],factory);
    }
    else if (typeof exports == "object")
    {

        module.exports = factory();
    }
    else
    {

        root.myclass = factory;
    }

})(this, function (opt) {
    alert(JSON.stringify(opt));
    function calc(x, y) {
        return x + y;
    }

    return calc;
})